    /********************************************************/
    /*                                                      */
    /*                                                      */
    /*         Copyright (C), 1993  SEIKO EPSON Corp.       */
    /*         ALL RIGHTS RESERVED                          */
    /*                                                      */
    /*                                                      */
    /*  file name : fputs.c                                 */
    /*                                                      */
    /*  Revision history                                    */
    /*      93/12/17    first release       S.Akaiwa        */
    /*      97/3/17	modified	    T.Katahira	    */
    /*			change function declaration	    */
    /*					to the ANSI style   */
    /*                                                      */
    /********************************************************/

#ifdef  UNIX
#include    "stdio.h"
#else
#include    <stdio.h>
#endif

int
fputs(const char * sStrP, FILE * fiStrmP)

    /********************************************************/
    /*                                                      */
    /*  The fputs function writes a string to stream        */
    /*  pointed to by fiStrmP.                              */
    /*  If stdout or stderr is not specified by fiStrmP,    */
    /*  the fputs function returns EOF.                     */
    /*  '\n' character is not added after string.           */
    /*                                                      */
    /*      RETURN  0       ... Success                     */
    /*              EOF     ... Error                       */  
    /*  <ANSI>                                              */
    /*      The fputs function writes a string to user      */
    /*      specified stream.                               */
    /*                                                      */
    /*      RETURN  integer ... Success                     */
    /*              EOF     ... Error                       */
    /*                                                      */
    /********************************************************/

    /* const char    *sStrP  ;     pointer to output string */
    /* FILE    *fiStrmP;           pointer to target stream */
    {

     int    iOfst;                /* write offset in buffer */
     
     if((fiStrmP != stdout) && (fiStrmP != stderr)){
        return  (int)EOF;                 /* illegal stream */
     }

     iOfst = 0;                       /* clear write offset */

     while(sStrP[iOfst] != '\0'){  /* until null terminator */
        if(putc((int)sStrP[iOfst], fiStrmP) == EOF){
           return   (int)EOF;                /* write error */
        }

        iOfst++;
     }

     return (int)0;                           /* successful */
    }

